var events=require("events");//原生模块
var Emitter=events.EventEmitter;
var eventObj=new Emitter();//事件对象实例化
eventObj.on("sayHello",function(){//事件监听
    console.log("hello world");
})
setTimeout(()=>{
    eventObj.emit("sayHello");//事件的触发
},3000)